package com.doucome.snapshot.view
{
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	/**
	 * ...
	 * @author wkl
	 */
	public class WindowError extends MovieClip
	{
		
		private var _txt_err:TextField;
		private var _txt_msg:String = "...";
		private var _btn:SimpleButton;
		private var _mask:Sprite;
		public function WindowError()
		{
			_btn = getChildByName('btn_confirm') as SimpleButton;
			_txt_err = getChildByName("txt_err") as TextField;
			_txt_err.text = "";
			_mask = new Sprite();
			_mask.graphics.beginFill(0x000000, 100);
			_mask.graphics.drawRect(0, 0, 760, 580);
			_mask.alpha = 0.7;
			_mask.visible = true;
			addChild(_mask);
		    setChildIndex(_mask,0);
			_btn.addEventListener(MouseEvent.CLICK, close);
		}
		
		public function get txt_msg():String
		{
			return _txt_msg;
		}
		
		public function set txt_msg(value:String):void
		{
			_txt_msg = value;
			_txt_err.text = _txt_msg;
		}
		
		public function get btn():SimpleButton 
		{
			return _btn;
		}
		
		public function set btn(value:SimpleButton):void 
		{
			_btn = value;
		}
		
		public function open(msg:String):void
		{
			this.visible = true;
			txt_msg = msg;
			
			
		}
		
		public function close(e:MouseEvent):void
		{
			this.visible = false;
		}
	
	}

}